<?php

class MenuPeer extends BaseMenuPeer
{
    /**
     * return menu object by name
     *
     * @return Menu
     */
    public static function retrieveByName($name){
        $c= new Criteria();
        $c->addJoin(self::ID , MenuI18nPeer::ID );
        $c->add(MenuI18nPeer::NAME , $name);
        return self::doSelectOne($c);
    }
    public static function getSiteMapMenus(){
        $c= new Criteria();
        $c->add(self::SHOW_ON_SITEMAP  ,1 );
        $c->addDescendingOrderByColumn( self::WEIGHT );
        //var_dump( self::doSelect($c));exit;
        return self::doSelect($c);
    }
}
